#include <Preprocessor.h>
#include <memory>
namespace Umikaze::Core {

class Texture;
class RenderTexture;
class Shader;

class Blit {
  CORE_OBJECT
public:
  static void blitToDefault(const std::shared_ptr<Texture> &color);

  static void blitToDefault(const std::shared_ptr<Texture> &color,
                            const std::shared_ptr<Texture> &depth);

  static void blitToDefault(const std::shared_ptr<Texture> &color,
                            const std::unique_ptr<Shader> &shader);

  static void blitToDefault(const std::shared_ptr<Texture> &color,
                            const std::shared_ptr<Texture> &depth,
                            const std::unique_ptr<Shader> &shader);

  static void blitColor(const std::shared_ptr<Texture> &from,
                        const std::shared_ptr<RenderTexture> &target);

  static void blitColor(const std::shared_ptr<Texture> &from,
                        const std::shared_ptr<RenderTexture> &target,
                        const std::unique_ptr<Shader> &shader);

  static void blitDepth(const std::shared_ptr<Texture> &from,
                        const std::shared_ptr<RenderTexture> &target);

private:
  static void drawQuad();
  static std::unique_ptr<Shader> blitShader;
  static uint32_t blitFbo;
  static void init();
};
} // namespace Umikaze::Core
